<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>ztree分类展示</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/ztree/css/metroStyle/metroStyle.css">
</head>
<body>
<div>
    <ul id="treeDemo" class="ztree"></ul>
</div>

<script src="${pageContext.request.contextPath}/layui/layui.js"></script>
<script src="${pageContext.request.contextPath}/ztree/js/jquery-1.4.4.min.js"></script>
<script src="${pageContext.request.contextPath}/ztree/js/jquery.ztree.all.js"></script>

<script>
    $(function () {
        var settings = {
            data: {
                simpleData: {
                    enable: true,  //true , false 分别表示 使用  不使用 简单数据模式
                }
            }
        };
        $.ajax({
            url:"${pageContext.request.contextPath}/category/selectAll_ztree",
            success: function (data) {
                zTreeObj = $.fn.zTree.init($("#treeDemo"), settings, data); //初始化树
            }
        })


    })
</script>
</body>
</html>